package api

import (
	"github.com/gin-gonic/gin"
	"order/api/handler"
)

func Register(r *gin.Engine) {
	user := r.Group("./user")
	user.POST("/register", handler.Register)
}

func Login(r *gin.Engine) {
	user := r.Group("./user")
	user.POST("/login", handler.Login)
}

func CreatePro(r *gin.Engine) {
	pro := r.Group("./product")
	pro.POST("/create", handler.CreatePro)
}

func FindPro(r *gin.Engine) {
	pro := r.Group("./product")
	pro.POST("/find", handler.FindPro)
}

func UpdatePro(r *gin.Engine) {
	pro := r.Group("./product")
	pro.POST("/update", handler.UpdatePro)
}

func DelPro(r *gin.Engine) {
	pro := r.Group("./product")
	pro.POST("/del", handler.DelPro)
}

func CreateCom(r *gin.Engine) {
	com := r.Group("./comment")
	com.POST("/create", handler.CreateCom)
}

func FindCom(r *gin.Engine) {
	com := r.Group("./comment")
	com.POST("/find", handler.FindCom)
}

func UpdateCom(r *gin.Engine) {
	com := r.Group("./comment")
	com.POST("/update", handler.UpdateCom)
}

func DelCom(r *gin.Engine) {
	com := r.Group("./comment")
	com.POST("/del", handler.DelCom)
}

func CreateOrder(r *gin.Engine) {
	order := r.Group("./order")
	order.POST("/create", handler.CreateOrder)
}

func FindOrder(r *gin.Engine) {
	order := r.Group("./order")
	order.POST("/find", handler.FindOrder)
}

func UpdateOrder(r *gin.Engine) {
	order := r.Group("./order")
	order.POST("/update", handler.UpdateOrder)
}

func DelOrder(r *gin.Engine) {
	order := r.Group("./order")
	order.POST("/del", handler.DelOrder)
}
